package ru.spbau.krasko.phonelock.dynamic;

import ru.spbau.krasko.phonelock.utils.Constants;
import net.rim.device.api.system.Bitmap;
import net.rim.device.api.ui.Graphics;

public class AppChooser extends DynamicField {

	private static final Bitmap bitmap = Bitmap.getBitmapResource("unlock.png");
	private static final int width = bitmap.getWidth();
	private static final int height = bitmap.getHeight();

	public AppChooser() {
		super(Constants.SCREEN_W / 2, Constants.SCREEN_H / 2);
	}

	public void paint(Graphics g) {
		g.drawBitmap(getRealX() - width / 2, getRealY() - height / 2,
				width, height, bitmap, 0, 0);
	}

	public void initInteraction(DynamicField df) {
		df.interact(this);
	}

	public void interact(DynamicIcon df) {
		df.performAction();
	}

}
